// pages/intro/intro.js
let app = getApp()
let CODE_SRC = app.globalData.CODE_SRC
Page({

  /**
   * 页面的初始数据
   */
  data: {
    CODE_SRC,
    arr: [
      {
        name: '嵌入式',
        photos: [
          {
            src: 'https://7761-wang2023-5gng88vf3d3ea81f-1256272801.tcb.qcloud.la/lot/%E5%B5%8C%E5%85%A5%E5%BC%8F%E8%BD%AF%E4%BB%B6%E5%B7%A5%E7%A8%8B%E5%B8%88%2013927279473_%E9%A1%B5%E9%9D%A2_1.png?sign=a91b0ba050ae4ef45099964c2ec08858&t=1694352134'
          },
          {
            src: 'https://7761-wang2023-5gng88vf3d3ea81f-1256272801.tcb.qcloud.la/lot/%E5%B5%8C%E5%85%A5%E5%BC%8F%E8%BD%AF%E4%BB%B6%E5%B7%A5%E7%A8%8B%E5%B8%88%2013927279473_%E9%A1%B5%E9%9D%A2_2.png?sign=2f1b607857c3a34d65dcafa0f55fc1b9&t=1694352163'
          }
        ],
        index: 0,
        type: '嵌入式'
      },
      {
        name:"h5",
        photos: [
          {
            src: 'https://7761-wang2023-5gng88vf3d3ea81f-1256272801.tcb.qcloud.la/h5/h5_%E9%A1%B5%E9%9D%A2_1.png?sign=ebf10dc5fdf0c2d00f26f3af91184c81&t=1694354107',
          },
          {
            src: 'https://7761-wang2023-5gng88vf3d3ea81f-1256272801.tcb.qcloud.la/h5/h5_%E9%A1%B5%E9%9D%A2_2.png?sign=9a0d6ff8a40e585565b49b229804e282&t=1694354155',
          },
          {
            src: 'https://7761-wang2023-5gng88vf3d3ea81f-1256272801.tcb.qcloud.la/h5/h5_%E9%A1%B5%E9%9D%A2_3.png?sign=18b831f9b2c5234bdef030f81647a5e7&t=1694354378',
          },
          {
            src: 'https://7761-wang2023-5gng88vf3d3ea81f-1256272801.tcb.qcloud.la/h5/h5_%E9%A1%B5%E9%9D%A2_4.png?sign=635b1df2069111cc1f14f37b12710397&t=1694354394',
          },
          {
            src: 'https://7761-wang2023-5gng88vf3d3ea81f-1256272801.tcb.qcloud.la/h5/h5_%E9%A1%B5%E9%9D%A2_5.png?sign=4a3a1373e40e41a32040a43ae9116a0d&t=1694354410',
          }
        ],
        index: 1,
        type: 'h5'
      },{
        name: 'java',
        photos: [
          {
            src: 'https://7761-wang2023-5gng88vf3d3ea81f-1256272801.tcb.qcloud.la/java/java%E5%BC%80%E5%8F%91%E5%B7%A5%E7%A8%8B%E5%B8%88_%E9%A1%B5%E9%9D%A2_1.png?sign=66df3dac233cf07e7e107464323f0894&t=1694352049'
          },
          {
            src: 'https://7761-wang2023-5gng88vf3d3ea81f-1256272801.tcb.qcloud.la/java/java%E5%BC%80%E5%8F%91%E5%B7%A5%E7%A8%8B%E5%B8%88_%E9%A1%B5%E9%9D%A2_2.png?sign=ec950517ce857380c040963ae1a2328c&t=1694352066'
          }
        ],
        index: 2,
        type: 'java'
      },{
        name: 'php',
        photos: [
          {
            src: 'https://7761-wang2023-5gng88vf3d3ea81f-1256272801.tcb.qcloud.la/php/php.jpg?sign=da443ca4f0e7a281a09b7291954ed2af&t=1694355370'
          }
        ],
        index:3,
        type: 'php'
      }
      ,{
        name: 'python',
        photos: [
          {
            src22: 'https://7761-wang2023-5gng88vf3d3ea81f-1256272801.tcb.qcloud.la/python/python.jpg?sign=852f8dbbe7f790aadf518920526562af&t=1694355460',
            src:'https://7761-wang2023-5gng88vf3d3ea81f-1256272801.tcb.qcloud.la/python/python.png?sign=00551c214a7a04d749529d2c0550b730&t=1696564706'
          }
        ],
        index:4,
        type: 'python'
      }
    ]
  },
  onPreviewTap: function(event) {
    var src = event.currentTarget.dataset.src
    let newArr = this.data.arr.map(item=>item.src)
    wx.previewImage({
      current: src,
      urls: newArr
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    if(options){
      let index = options.index;
      let type = options.type;
      if(index){
        this.setData({index})
      }
      if(type){
        this.setData({type})
      }
    }
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})